using System;
using Istace.Framework.Mapping.Core.Interfaces;

namespace Istace.Framework.Mapping.UnitTest
{
    /// <summary>
    /// Convert integer to string
    /// </summary>
    public class IntegerToStringMapper : IMapper<int, string>, IMapper<string, int>
    {
        public string Map(int instanceToMap)
        {
            return instanceToMap.ToString();
        }

        public int Map(string instanceToMap)
        {
            int value;
            Int32.TryParse(instanceToMap, out value);
            return value;
        }
    }
}